#include "player.h"

player::player(string filename, Arena* level) : creature(filename, level)
{
	mXPosition = 60;
	mYPosition = 60;
	m_is_saved = false;
}

void player::left()
{
	creature::left();
	m_is_saved = false;
}

void player::right()
{
	m_going_down = false;
	m_going_up = false;
	m_going_right = true;
	m_going_left = false;
	if(map->IsEmpty(mXPosition + 21, mYPosition) == '.')
	{
		mXPosition += 20;
	}
	else if(map->IsEmpty(mXPosition + 21, mYPosition) == 'p')
	{
		m_is_saved = true;
	}
}

bool player::DidReachPolice()
{
	return m_is_saved;
}